Form_CardApplicationViewing = function(){
	var obj = this;
	
	var storeApplicationProxy = new Ext.data.HttpProxy({url : "/manage/getCardApplications"});
	var storeApplication = new Ext.data.Store({
		proxy : storeApplicationProxy,
		reader : new Ext.data.ArrayReader({
			fields : ["name", "mobile", "updateTime"]
		})
	});
	var listDateField = new Ext.form.DateField({
		xtype : "datefield",
		format : "Y-m-d",
		emptyText : "请填入日期...",
		width : 200,
		allowBlank : false
	});
	var comboCoding = new Ext.form.ComboBox({
		emptyText : "请选择编码...",
		editable : false,
		triggerAction : "all",
		mode : "local",
		hiddenName : "coding",
		valueField : "coding",
		displayField : "name",
		store : new Ext.data.ArrayStore({
			fields : ["coding", "name"],
			data : [["utf-8", "UTF-8"], ["gb18030", "GB18030"]]
		})
	});
	var listApplication = new Ext.grid.GridPanel({
		store : storeApplication,
		region : "center",
		margins : "5 5 5 5",
		columns : [
			{id : "name", header : "用户名", dataIndex : "name", width : 100},
			{id : "mobile", header : "手机号", dataIndex : "mobile", width : 100},
			{id : "updateTime", header : "申请时间", dataIndex : "updateTime", width : 100}
		],
		tbar : [listDateField, {
			text : "刷新",
			listeners : {
				click : function(){
					storeApplicationProxy.setUrl("/manage/getCardApplications?start_time=" + listDateField.getValue().format("Y-m-d"));
					storeApplication.load();
				}
			}
		}, "-", comboCoding, {
			text : "导出",
			listeners : {
				click : function(){
					window.location.href = "/manage/getCardApplicationsByFile?start_time=" + listDateField.getValue().format("Y-m-d") + "&encoding=" +  comboCoding.getValue();
				}
			}
		}]
	})
	
	Form_CardApplicationViewing.superclass.constructor.call(this, {
		layout : "border",
		anchor : "100% 100%",
		items : [listApplication]
    });
}

Ext.extend(Form_CardApplicationViewing, Ext.Panel, {
});

Ext.reg("App.UserManagement.CardApplicationViewing", Form_CardApplicationViewing);